package br.UFSC.GRIMA.operationSolids;

import java.io.File;

import javax.vecmath.Color3f;



public class OperationCilinder extends CSGSolid{

	String name ="";
	float height =0;
	float radius = 0;
	
	public OperationCilinder(float height,float radius, String name){
		super();
		this.name = name;
		this.height = height;
		this.radius = radius;
		
		String[] cilinderArg =
		{
				"110",
				"0  0.00000000000000E+0000  5.00000000000000E-0001  0.00000000000000E+0000",
				"1  1.00000000000000E+0000  5.00000000000000E-0001  0.00000000000000E+0000",
				"2  9.39700000000000E-0001  5.00000000000000E-0001  3.42000000000000E-0001",
				"3  7.66000000000000E-0001  5.00000000000000E-0001  6.42800000000000E-0001",
				"4  5.00000000000000E-0001  5.00000000000000E-0001  8.66000000000000E-0001",
				"5  1.73600000000000E-0001  5.00000000000000E-0001  9.84800000000000E-0001",
				"6 -1.73600000000000E-0001  5.00000000000000E-0001  9.84800000000000E-0001",
				"7 -5.00000000000000E-0001  5.00000000000000E-0001  8.66000000000000E-0001",
				"8 -7.66000000000000E-0001  5.00000000000000E-0001  6.42800000000000E-0001",
				"9 -9.39700000000000E-0001  5.00000000000000E-0001  3.42000000000000E-0001",
				"10 -1.00000000000000E+0000  5.00000000000000E-0001 -0.00000000000000E+0000",
				"11 -9.39700000000000E-0001  5.00000000000000E-0001 -3.42000000000000E-0001",
				"12 -7.66000000000000E-0001  5.00000000000000E-0001 -6.42800000000000E-0001",
				"13 -5.00000000000000E-0001  5.00000000000000E-0001 -8.66000000000000E-0001",
				"14 -1.73600000000000E-0001  5.00000000000000E-0001 -9.84800000000000E-0001",
				"15  1.73600000000000E-0001  5.00000000000000E-0001 -9.84800000000000E-0001",
				"16  5.00000000000000E-0001  5.00000000000000E-0001 -8.66000000000000E-0001",
				"17  7.66000000000000E-0001  5.00000000000000E-0001 -6.42800000000000E-0001",
				"18  9.39700000000000E-0001  5.00000000000000E-0001 -3.42000000000000E-0001",
				"19  1.00000000000000E+0000  3.00000000000000E-0001 -0.00000000000000E+0000",
				"20  9.39700000000000E-0001  3.00000000000000E-0001  3.42000000000000E-0001",
				"21  7.66000000000000E-0001  3.00000000000000E-0001  6.42800000000000E-0001",
				"22  5.00000000000000E-0001  3.00000000000000E-0001  8.66000000000000E-0001",
				"23  1.73600000000000E-0001  3.00000000000000E-0001  9.84800000000000E-0001",
				"24 -1.73600000000000E-0001  3.00000000000000E-0001  9.84800000000000E-0001",
				"25 -5.00000000000000E-0001  3.00000000000000E-0001  8.66000000000000E-0001",
				"26 -7.66000000000000E-0001  3.00000000000000E-0001  6.42800000000000E-0001",
				"27 -9.39700000000000E-0001  3.00000000000000E-0001  3.42000000000000E-0001",
				"28 -1.00000000000000E+0000  3.00000000000000E-0001 -0.00000000000000E+0000",
				"29 -9.39700000000000E-0001  3.00000000000000E-0001 -3.42000000000000E-0001",
				"30 -7.66000000000000E-0001  3.00000000000000E-0001 -6.42800000000000E-0001",
				"31 -5.00000000000000E-0001  3.00000000000000E-0001 -8.66000000000000E-0001",
				"32 -1.73600000000000E-0001  3.00000000000000E-0001 -9.84800000000000E-0001",
				"33  1.73600000000000E-0001  3.00000000000000E-0001 -9.84800000000000E-0001",
				"34  5.00000000000000E-0001  3.00000000000000E-0001 -8.66000000000000E-0001",
				"35  7.66000000000000E-0001  3.00000000000000E-0001 -6.42800000000000E-0001",
				"36  9.39700000000000E-0001  3.00000000000000E-0001 -3.42000000000000E-0001",
				"37  1.00000000000000E+0000  1.00000000000000E-0001 -0.00000000000000E+0000",
				"38  9.39700000000000E-0001  1.00000000000000E-0001  3.42000000000000E-0001",
				"39  7.66000000000000E-0001  1.00000000000000E-0001  6.42800000000000E-0001",
				"40  5.00000000000000E-0001  1.00000000000000E-0001  8.66000000000000E-0001",
				"41  1.73600000000000E-0001  1.00000000000000E-0001  9.84800000000000E-0001",
				"42 -1.73600000000000E-0001  1.00000000000000E-0001  9.84800000000000E-0001",
				"43 -5.00000000000000E-0001  1.00000000000000E-0001  8.66000000000000E-0001",
				"44 -7.66000000000000E-0001  1.00000000000000E-0001  6.42800000000000E-0001",
				"45 -9.39700000000000E-0001  1.00000000000000E-0001  3.42000000000000E-0001",
				"46 -1.00000000000000E+0000  1.00000000000000E-0001 -0.00000000000000E+0000",
				"47 -9.39700000000000E-0001  1.00000000000000E-0001 -3.42000000000000E-0001",
				"48 -7.66000000000000E-0001  1.00000000000000E-0001 -6.42800000000000E-0001",
				"49 -5.00000000000000E-0001  1.00000000000000E-0001 -8.66000000000000E-0001",
				"50 -1.73600000000000E-0001  1.00000000000000E-0001 -9.84800000000000E-0001",
				"51  1.73600000000000E-0001  1.00000000000000E-0001 -9.84800000000000E-0001",
				"52  5.00000000000000E-0001  1.00000000000000E-0001 -8.66000000000000E-0001",
				"53  7.66000000000000E-0001  1.00000000000000E-0001 -6.42800000000000E-0001",
				"54  9.39700000000000E-0001  1.00000000000000E-0001 -3.42000000000000E-0001",
				"55  1.00000000000000E+0000 -1.00000000000000E-0001 -0.00000000000000E+0000",
				"56  9.39700000000000E-0001 -1.00000000000000E-0001  3.42000000000000E-0001",
				"57  7.66000000000000E-0001 -1.00000000000000E-0001  6.42800000000000E-0001",
				"58  5.00000000000000E-0001 -1.00000000000000E-0001  8.66000000000000E-0001",
				"59  1.73600000000000E-0001 -1.00000000000000E-0001  9.84800000000000E-0001",
				"60 -1.73600000000000E-0001 -1.00000000000000E-0001  9.84800000000000E-0001",
				"61 -5.00000000000000E-0001 -1.00000000000000E-0001  8.66000000000000E-0001",
				"62 -7.66000000000000E-0001 -1.00000000000000E-0001  6.42800000000000E-0001",
				"63 -9.39700000000000E-0001 -1.00000000000000E-0001  3.42000000000000E-0001",
				"64 -1.00000000000000E+0000 -1.00000000000000E-0001 -0.00000000000000E+0000",
				"65 -9.39700000000000E-0001 -1.00000000000000E-0001 -3.42000000000000E-0001",
				"66 -7.66000000000000E-0001 -1.00000000000000E-0001 -6.42800000000000E-0001",
				"67 -5.00000000000000E-0001 -1.00000000000000E-0001 -8.66000000000000E-0001",
				"68 -1.73600000000000E-0001 -1.00000000000000E-0001 -9.84800000000000E-0001",
				"69  1.73600000000000E-0001 -1.00000000000000E-0001 -9.84800000000000E-0001",
				"70  5.00000000000000E-0001 -1.00000000000000E-0001 -8.66000000000000E-0001",
				"71  7.66000000000000E-0001 -1.00000000000000E-0001 -6.42800000000000E-0001",
				"72  9.39700000000000E-0001 -1.00000000000000E-0001 -3.42000000000000E-0001",
				"73  1.00000000000000E+0000 -3.00000000000000E-0001 -0.00000000000000E+0000",
				"74  9.39700000000000E-0001 -3.00000000000000E-0001  3.42000000000000E-0001",
				"75  7.66000000000000E-0001 -3.00000000000000E-0001  6.42800000000000E-0001",
				"76  5.00000000000000E-0001 -3.00000000000000E-0001  8.66000000000000E-0001",
				"77  1.73600000000000E-0001 -3.00000000000000E-0001  9.84800000000000E-0001",
				"78 -1.73600000000000E-0001 -3.00000000000000E-0001  9.84800000000000E-0001",
				"79 -5.00000000000000E-0001 -3.00000000000000E-0001  8.66000000000000E-0001",
				"80 -7.66000000000000E-0001 -3.00000000000000E-0001  6.42800000000000E-0001",
				"81 -9.39700000000000E-0001 -3.00000000000000E-0001  3.42000000000000E-0001",
				"82 -1.00000000000000E+0000 -3.00000000000000E-0001 -0.00000000000000E+0000",
				"83 -9.39700000000000E-0001 -3.00000000000000E-0001 -3.42000000000000E-0001",
				"84 -7.66000000000000E-0001 -3.00000000000000E-0001 -6.42800000000000E-0001",
				"85 -5.00000000000000E-0001 -3.00000000000000E-0001 -8.66000000000000E-0001",
				"86 -1.73600000000000E-0001 -3.00000000000000E-0001 -9.84800000000000E-0001",
				"87  1.73600000000000E-0001 -3.00000000000000E-0001 -9.84800000000000E-0001",
				"88  5.00000000000000E-0001 -3.00000000000000E-0001 -8.66000000000000E-0001",
				"89  7.66000000000000E-0001 -3.00000000000000E-0001 -6.42800000000000E-0001",
				"90  9.39700000000000E-0001 -3.00000000000000E-0001 -3.42000000000000E-0001",
				"91  1.00000000000000E+0000 -5.00000000000000E-0001 -0.00000000000000E+0000",
				"92  9.39700000000000E-0001 -5.00000000000000E-0001  3.42000000000000E-0001",
				"93  7.66000000000000E-0001 -5.00000000000000E-0001  6.42800000000000E-0001",
				"94  5.00000000000000E-0001 -5.00000000000000E-0001  8.66000000000000E-0001",
				"95  1.73600000000000E-0001 -5.00000000000000E-0001  9.84800000000000E-0001",
				"96 -1.73600000000000E-0001 -5.00000000000000E-0001  9.84800000000000E-0001",
				"97 -5.00000000000000E-0001 -5.00000000000000E-0001  8.66000000000000E-0001",
				"98 -7.66000000000000E-0001 -5.00000000000000E-0001  6.42800000000000E-0001",
				"99 -9.39700000000000E-0001 -5.00000000000000E-0001  3.42000000000000E-0001",
				"100 -1.00000000000000E+0000 -5.00000000000000E-0001 -0.00000000000000E+0000",
				"101 -9.39700000000000E-0001 -5.00000000000000E-0001 -3.42000000000000E-0001",
				"102 -7.66000000000000E-0001 -5.00000000000000E-0001 -6.42800000000000E-0001",
				"103 -5.00000000000000E-0001 -5.00000000000000E-0001 -8.66000000000000E-0001",
				"104 -1.73600000000000E-0001 -5.00000000000000E-0001 -9.84800000000000E-0001",
				"105  1.73600000000000E-0001 -5.00000000000000E-0001 -9.84800000000000E-0001",
				"106  5.00000000000000E-0001 -5.00000000000000E-0001 -8.66000000000000E-0001",
				"107  7.66000000000000E-0001 -5.00000000000000E-0001 -6.42800000000000E-0001",
				"108  9.39700000000000E-0001 -5.00000000000000E-0001 -3.42000000000000E-0001",
				"109  0.00000000000000E+0000 -5.00000000000000E-0001 -0.00000000000000E+0000",
				"216",
				"0 0 2 1",
				"1 0 3 2",
				"2 0 4 3", 
				"3 0 5 4", 
				"4 0 6 5", 
				"5 0 7 6", 
				"6 0 8 7", 
				"7 0 9 8", 
				"8 0 10 9", 
				"9 0 11 10", 
				"10 0 12 11", 
				"11 0 13 12", 
				"12 0 14 13", 
				"13 0 15 14", 
				"14 0 16 15", 
				"15 0 17 16", 
				"16 0 18 17", 
				"17 0 1 18", 
				"18 1 20 19", 
				"19 1 2 20", 
				"20 2 21 20", 
				"21 2 3 21", 
				"22 3 22 21", 
				"23 3 4 22", 
				"24 4 23 22", 
				"25 4 5 23", 
				"26 5 24 23", 
				"27 5 6 24", 
				"28 6 25 24", 
				"29 6 7 25", 
				"30 7 26 25", 
				"31 7 8 26", 
				"32 8 27 26", 
				"33 8 9 27", 
				"34 9 28 27", 
				"35 9 10 28", 
				"36 10 29 28", 
				"37 10 11 29", 
				"38 11 30 29", 
				"39 11 12 30", 
				"40 12 31 30", 
				"41 12 13 31", 
				"42 13 32 31", 
				"43 13 14 32", 
				"44 14 33 32", 
				"45 14 15 33", 
				"46 15 34 33", 
				"47 15 16 34", 
				"48 16 35 34", 
				"49 16 17 35", 
				"50 17 36 35",
				"51 17 18 36",
				"52 18 19 36", 
				"53 18 1 19", 
				"54 19 38 37", 
				"55 19 20 38", 
				"56 20 39 38", 
				"57 20 21 39", 
				"58 21 40 39", 
				"59 21 22 40", 
				"60 22 41 40", 
				"61 22 23 41", 
				"62 23 42 41", 
				"63 23 24 42", 
				"64 24 43 42", 
				"65 24 25 43", 
				"66 25 44 43", 
				"67 25 26 44", 
				"68 26 45 44", 
				"69 26 27 45", 
				"70 27 46 45", 
				"71 27 28 46", 
				"72 28 47 46", 
				"73 28 29 47", 
				"74 29 48 47",
				"75 29 30 48", 
				"76 30 49 48", 
				"77 30 31 49", 
				"78 31 50 49", 
				"79 31 32 50", 
				"80 32 51 50", 
				"81 32 33 51", 
				"82 33 52 51", 
				"83 33 34 52", 
				"84 34 53 52", 
				"85 34 35 53", 
				"86 35 54 53", 
				"87 35 36 54", 
				"88 36 37 54", 
				"89 36 19 37", 
				"90 37 56 55", 
				"91 37 38 56", 
				"92 38 57 56", 
				"93 38 39 57", 
				"94 39 58 57", 
				"95 39 40 58", 
				"96 40 59 58", 
				"97 40 41 59", 
				"98 41 60 59", 
				"99 41 42 60",
				"100 42 61 60", 
				"101 42 43 61", 
				"102 43 62 61", 
				"103 43 44 62", 
				"104 44 63 62", 
				"105 44 45 63", 
				"106 45 64 63", 
				"107 45 46 64", 
				"108 46 65 64", 
				"109 46 47 65", 
				"110 47 66 65", 
				"111 47 48 66", 
				"112 48 67 66", 
				"113 48 49 67", 
				"114 49 68 67", 
				"115 49 50 68", 
				"116 50 69 68", 
				"117 50 51 69", 
				"118 51 70 69", 
				"119 51 52 70", 
				"120 52 71 70", 
				"121 52 53 71", 
				"122 53 72 71", 
				"123 53 54 72", 
				"124 54 55 72", 
				"125 54 37 55", 
				"126 55 74 73", 
				"127 55 56 74", 
				"128 56 75 74", 
				"129 56 57 75", 
				"130 57 76 75", 
				"131 57 58 76", 
				"132 58 77 76", 
				"133 58 59 77", 
				"134 59 78 77", 
				"135 59 60 78", 
				"136 60 79 78", 
				"137 60 61 79", 
				"138 61 80 79", 
				"139 61 62 80", 
				"140 62 81 80", 
				"141 62 63 81", 
				"142 63 82 81", 
				"143 63 64 82", 
				"144 64 83 82", 
				"145 64 65 83", 
				"146 65 84 83", 
				"147 65 66 84", 
				"148 66 85 84", 
				"149 66 67 85", 
				"150 67 86 85", 
				"151 67 68 86", 
				"152 68 87 86", 
				"153 68 69 87", 
				"154 69 88 87", 
				"155 69 70 88", 
				"156 70 89 88", 
				"157 70 71 89", 
				"158 71 90 89", 
				"159 71 72 90", 
				"160 72 73 90", 
				"161 72 55 73", 
				"162 73 92 91", 
				"163 73 74 92", 
				"164 74 93 92", 
				"165 74 75 93", 
				"166 75 94 93", 
				"167 75 76 94", 
				"168 76 95 94", 
				"169 76 77 95", 
				"170 77 96 95", 
				"171 77 78 96", 
				"172 78 97 96", 
				"173 78 79 97", 
				"174 79 98 97", 
				"175 79 80 98", 
				"176 80 99 98", 
				"177 80 81 99", 
				"178 81 100 99", 
				"179 81 82 100", 
				"180 82 101 100", 
				"181 82 83 101", 
				"182 83 102 101", 
				"183 83 84 102", 
				"184 84 103 102", 
				"185 84 85 103", 
				"186 85 104 103", 
				"187 85 86 104", 
				"188 86 105 104", 
				"189 86 87 105", 
				"190 87 106 105", 
				"191 87 88 106", 
				"192 88 107 106", 
				"193 88 89 107", 
				"194 89 108 107", 
				"195 89 90 108", 
				"196 90 91 108", 
				"197 90 73 91", 
				"198 109 91 92", 
				"199 109 92 93", 
				"200 109 93 94", 
				"201 109 94 95", 
				"202 109 95 96", 
				"203 109 96 97", 
				"204 109 97 98", 
				"205 109 98 99", 
				"206 109 99 100", 
				"207 109 100 101", 
				"208 109 101 102", 
				"209 109 102 103", 
				"210 109 103 104", 
				"211 109 104 105", 
				"212 109 105 106",
				"213 109 106 107",
				"214 109 107 108",
				"215 109 108 91"
		};
		
		loadCoordinateFile(cilinderArg,new Color3f(0.3f,0.3f,0.3f));
		scale(radius*5, height*5, radius*5);
	}
	
	@Override
	public CSGSolid copy()
	{
		OperationCilinder cylinder = new OperationCilinder(height,radius,name);
		cylinder.updateLocation(getLocation());
		return cylinder;
	}

}
